{include file="public/header" /}
<link rel="stylesheet" href="/static/admin/css/login.css" media="all">
<style>
    .layui-form-checkbox[lay-skin=primary]>div{
        color: #fff;
    }
    .layui-input{
        border-radius: 3px;
    }
</style>
<body class="login-bg">
<div class="layadmin-user-login layadmin-user-display-show form">

    <div class="layadmin-user-login-main">

        <div class="right-par">
            <div class="layadmin-user-login-box layadmin-user-login-header">
                <h2 class="message" style="float: left;color: #3B91FF;font-size: 20px">👋 Hi 欢迎回来 ~</h2>

            </div>
            <div class="layadmin-user-login-box layadmin-user-login-body">
                <form class="layui-form" id="form">

                    <div class="layui-form-item">
                        <div class="layui-input-wrap">
                            <div class="layui-input-prefix">
                                <i class="layui-icon layui-icon-username"></i>
                            </div>
                            <input type="text" name="admin_name" lay-verify="required"
                                   lay-reqtext="请填写账号"
                                   lay-verType="tips" placeholder="请填写账号" autocomplete="off"
                                   autocomplete="off"
                                   class="layui-input" lay-affix="clear" >
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-wrap">
                            <div class="layui-input-prefix">
                                <i class="layui-icon layui-icon-password"></i>
                            </div>
                            <input type="password" name="password" lay-verify="required" lay-reqtext="请填写登录密码"
                                   lay-verType="tips" placeholder="请填写登录密码" autocomplete="off"
                                   class="layui-input"
                                   lay-affix="eye" >
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-row" style="display: flex;align-items: center;justify-content: center">
                            <div class="layui-col-xs7">
                                <div class="layui-input-wrap">
                                    <div class="layui-input-prefix">
                                        <i class="layui-icon layui-icon-vercode"></i>
                                    </div>
                                    <input type="text" name="captcha" lay-verify="required"
                                           lay-reqtext="请填写图形验证码"
                                           lay-verType="tips" placeholder="图形验证码" autocomplete="off"
                                           class="layui-input" lay-affix="clear">
                                </div>
                            </div>
                            <div class="layui-col-xs5">
                                <div style="margin-left: 10px;">
                                    <img src="{:captcha_src()}" id="captcha" class="layadmin-user-login-codeimg"
                                         onclick="this.src='{:captcha_src()}?'+Math.random();" style="border-radius: 3px">
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item" style="text-align: center">
                        <button style="margin-top: 15px;width: 95%;background:  #3B91FF" type="submit"
                                class="layui-btn layui-btn-fluid"
                                lay-submit="" lay-filter="login">登 录
                        </button>
                    </div>

                </form>

            </div>
        </div>

    </div>
</div>
<div id="holder"
     style="background: url(https://static.resource.zhiju002.com/login/bg{$random}.jpg) no-repeat center;"></div>
<div class="web-title">
    {if !empty(cache('system')['web_site_logo'])}
    <img class="logo" src="{:cache('system')['web_site_logo']}" style="width: 30px;height: 30px;margin-right: 10px"/>
    {/if}
    <h1 style="color: rgb(235,223,197);font-size: 1.9rem">{:cache('system')['web_site_title']??''}<span style="font-size: 13px;"></span>
    </h1>
</div>
</body>
{include file="public/footer" /}
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/lottie-web/5.12.2/lottie.min.js"></script>
<script>
    $login = location.href;
    $top = top.location.href;
    if ($top != $login) {
        top.location.href = '{:url("login/index")}';
    }
    layui.use('form', function () {
        var form = layui.form;
        form.on('submit(login)', function (data) {
            var load = layer.load();
            $.ajax({
                type: 'POST',
                url: '{:url("login/login")}',
                data: $("#form").serialize(),
                dataType: "json",
                success: function (data) {
                    layer.close(load);
                    if (data.code == 1) {
                        location.href = '{:url("index/index")}';
                    } else {
                        layer.msg(data.msg);
                        $('#captcha').attr('src', '{:captcha_src()}?' + Math.random());
                    }
                }
            });
            return false;
        });

    });

</script>

</html>